package Task22;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int size = scanner.nextInt();
            int ability = scanner.nextInt();
            int[] abilitys = new int[size];
            for (int i = 0; i < abilitys.length; i++) {
                abilitys[i] = scanner.nextInt();
            }
            for (int i = 0; i < abilitys.length; i++) {
                if(abilitys[i] > ability ){
                    ability = convention(ability,abilitys[i]) + ability;

                }else {
                    ability += abilitys[i];
                }
            }
            System.out.println(ability);
        }
    }
    public static int convention(int a,int b){
        int result = 0;
        while ( b != 0){
            result = a % b;
            a = b;
            b = result;
        }
        return a;
    }
}
